//
//  BKWebViewController.h
//  XPhoto
//
//  Created by baboy on 2019/4/26.
//  Copyright © 2019 baboy. All rights reserved.
//

#import "BKViewController.h"
#import <WebKit/WebKit.h>

#define BK_WEB_INJECTED_DATA_HOST_KEY              @"hosts"
#define BK_WEB_INJECTED_DATA_USERINFO_KEY          @"userInfo"
#define BK_WEB_INJECTED_DATA_USERINFO_HEADER_KEY   @"headers"
#define BK_WEB_INJECTED_DATA_USERINFO_USER_KEY     @"user"

NS_ASSUME_NONNULL_BEGIN

@interface BKWebViewController : BKViewController<WKUIDelegate,WKNavigationDelegate,WKScriptMessageHandler>

@property(nonatomic, strong) IBOutlet WKWebView * webView;
@property(nonatomic, strong) NSURL *currentURL;
@property(nonatomic, strong) NSDictionary *configuration;
@property(nonatomic, assign) BOOL shouldCreateNewWindow; //是否可以打开新窗口

+ (void)injectUserInfo:(NSDictionary *)userInfo cookies:(NSDictionary *)cookies forHosts:(NSArray *)hosts;

- (instancetype)initWithConfiguration:(NSDictionary *)configuration;
@end

NS_ASSUME_NONNULL_END
